import React, {render, Component} from './react'

// const root = document.getElementById('root')

const jsx = (
  <div>
    <p>Hello React</p>
    <p>Hello Fiber</p>
  </div>
)
// render(jsx, root)

// setTimeout(() => {
//   const jsx = (
//     <div>
//       {/* <div>奥里给</div> */}
//       <p>Hi Fiber</p>
//     </div>
//   )
//   render(jsx, root)
// }, 2000)

class Grating extends Component {
  constructor(props) {
    super(props)
    this.state = {
      name: '张三'
    }
  }
  render() {
    return (
    <div>
      3231221{this.props.title} {this.state.name}
      <button onClick={() => this.setState({name: '李四'})}>button</button>
    </div>)

  }
}
render(<Grating title="奥里给"/>, root)

// function FnComponent(props) {
//   return <div>FnComponent{props.title}</div>
// }

// render(<FnComponent title="hello"/>, root)
